package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type CarRequest struct {
	Serial      string `form:"serial" json:"serial"`
	KindID      uint   `form:"kind_id" json:"kind_id"`
	Inspection  string `form:"inspection" json:"inspection"`
	Maintenance string `form:"maintenance" json:"maintenance"`
	State       string `form:"state" json:"state"`
}

func (r *CarRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *CarRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{
		"serial":  "required",
		"kind_id": "required",
	}
}

func (r *CarRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *CarRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *CarRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
